<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏记录</title>
    <script>
        const restartUrl = "{{url_for('player.create_game')}}"
    </script>
    <script src="{{ url_for('static',filename='js/jquery-3.7.1.min.js') }}"></script>
    <script src="{{ url_for('static',filename='js/game_record.js') }}"></script>
    <script src="{{ url_for('static',filename='js/html2canvas.min.js') }}"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

        body {
            font-family: 'Roboto', Arial, sans-serif;
            background: linear-gradient(135deg, #4caf50, #81c784);
            color: #333;
            margin: 0;
            padding: 20px;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow-x: hidden;  /* 防止水平滚动 */
        }
        

        .container {
            display: flex;
            flex-direction: column;
            background: #ffffff;
            border-radius: 16px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            max-width: 100%;
            width: 100%;
            overflow: hidden;
        }

        .left {
            background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
            padding: 20px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border-bottom: 2px solid #81c784;
        }

        .game-grid {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            border: 2px solid #90a4ae;
            border-radius: 12px;
            background: #ffffff;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            max-height: 300px;
            overflow-y: auto;
        }

        .game-grid:hover {
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
            transform: scale(1.05);
        }

        .row {
            display: flex;
            justify-content: center;
            margin-bottom: 15px;
        }

        .row:last-child {
            margin-bottom: 0;
        }

        .cell {
            width: 60px;
            height: 60px;
            border: 2px solid #b0bec5;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            border-radius: 8px;
            margin: 0 5px;
            background: linear-gradient(135deg, #f5f5f5, #eeeeee);
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
        }

        .cell:hover {
            background: linear-gradient(135deg, #90caf9, #64b5f6);
            transform: scale(1.1);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .right {
            padding: 30px;
            background: linear-gradient(135deg, #ffcc80, #ffe0b2);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        h1 {
            font-size: 30px;
            color: #333;
            margin-bottom: 20px;
            background: linear-gradient(45deg, #ff7043, #ffcc80);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
        }

        .timestamp {
            color: #555;
            font-size: 14px;
            margin-bottom: 10px;
        }

        .score {
            font-size: 22px;
            color: #ff5722;
            margin: 20px 0;
            font-weight: bold;
            text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
        }

        .button-container {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }



        .button {
            background: linear-gradient(135deg, #66bb6a, #43a047);
            color: white;
            padding: 14px 30px;
            border: none;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            border-radius: 8px;
            margin: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            transition: all 0.3s ease;
            animation: pulse 2s infinite;
            display: flex;
            justify-content: center;  /* 保证按钮内容居中 */
            align-items: center;  /* 保证按钮内容垂直居中 */
            width: 90%;
        }
        
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        .button:hover {
            background: linear-gradient(135deg, #43a047, #66bb6a);
            transform: scale(1.05);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
        }

        .button i {
            margin-right: 10px;
        }

        p {
            color: #607d8b;
            font-size: 14px;
            margin-top: 20px;
            text-align: center;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                flex-direction: column;
                padding: 10px;
            }

            .left, .right {
                width: 100%;
                padding: 15px;
            }

            h1 {
                font-size: 28px;
            }

            .score {
                font-size: 20px;
            }

            .button {
                padding: 12px 25px;
                font-size: 14px;
            }

            .game-grid {
                padding: 10px;
            }

            .cell {
                width: 50px;
                height: 50px;
                font-size: 18px;
            }

            .button-container {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 左侧内容 -->
        <div class="left">
            <div class="game-grid">
                {% for row in paper_data %}
                <div class="row">
                    {% for cell in row %}
                    <div class="cell">{{ cell if cell else ' ' }}</div>
                    {% endfor %}
                </div>
                {% endfor %}
            </div>
        </div>

        <!-- 右侧内容 -->
        <div class="right">
            <h1>游戏记录</h1>
            <div class="timestamp">{{ timestamp }}</div>
            <div class="score">最终得分: {{ score }}</div>
            <div class="button-container">
                <button class="button" id="saveButton"><i class="fas fa-camera"></i>保存纪念照片</button>
                <form>
                    <button class="button" id="restartButton"><i class="fas fa-redo-alt"></i>重新开始</button>
                </form>
            </div>
            <p>感谢您的参与！</p>
        </div>
    </div>

</body>
</html>
